package com.haiwee.hellosb;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * @Auther: lichufeng
 * @Date: 2018/12/13 10:48
 * @Description:
 */

@RequestMapping(value = "/properties")
@RestController
public class PropertiesController {


    private final static Logger log = LoggerFactory.getLogger(PropertiesController.class);

    private final MyProperties1 myProperties1;

    private final MyProperties2 myProperties2;


    @Autowired
    public PropertiesController(MyProperties1 myProperties1,MyProperties2 myProperties2){
        this.myProperties1 = myProperties1;
        this.myProperties2 = myProperties2;
    }


    @GetMapping(value = "/1")
    public MyProperties1 getMyProperties1() {

        log.info("#######################################");
        log.info(myProperties1.toString());
        log.info("#######################################");
        return myProperties1;
    }

    @GetMapping(value = "/2")
    public MyProperties2 getMyProperties2(){

        log.info("#######################################");
        log.info(myProperties2.toString());
        log.info("#######################################");
        return myProperties2;
    }
}
